/*Author S.Genikhov
creatin data 20/Aug/2010
last modified 30/Aug/2010
reviewee by :

version 1.
Generic client,
Support only TCP connection */

#ifndef __GENERCLIENT__
#define __GENERCLIENT__

#include <arpa/inet.h>

#define  MAXPACKAGESIZE            (1500) /* max package size without include header*/
#define  IN
#define  OUT

typedef enum protoclol {TCP,UDP} prot_e;
typedef struct GenericClient_t Gcl;


typedef int (*IOfunc) (int _socketID, struct sockaddr_in* addr);
/*returns 0 if fails*/
Gcl* GclNewClient(int protocol,IOfunc _session, int serverPort,char* ClientIP);

/*returns 0 if succes and -1 if fail*/
int  GclConnectClient(Gcl*);

/*start the infinitive loop of send/recieve*/
int GclRunClient(Gcl* _gcl);

#endif /* __GENERCLIENT__*/
